import request from '@/axios'

export const getConditionTableListApi = (params: any) => {
  return request.post({ url: '/tickets/list', data: params })
}

export const getPasCountApi = (): Promise<IResponse<any[]>> => {
  return request.get({ url: '/tickets/pas' })
}

export const getPasNameApi = (): Promise<IResponse<any[]>> => {
  return request.get({ url: '/tickets/name' })
}

export const delTicketsApi = (params: any): Promise<IResponse> => {
  return request.get({ url: '/tickets/delete', params })
}

export const getConditionListApi = (params: any) => {
  return request.post({ url: '/tickets/condition/list', data: params })
}

export const addConditionApi = (params: any) => {
  return request.post({ url: '/tickets/condition/add', data: params })
}

export const delConditionApi = (params: any): Promise<IResponse> => {
  return request.get({ url: '/tickets/condition/delete', params })
}

export const frequencyAllApi = () => {
  return request.get({ url: '/tickets/frequency/all' })
}

export const updateConditionApi = (params: any) => {
  return request.post({ url: '/tickets/frequency/update', data: params })
}

export const downExcl = () => {
  return request.get({ url: '/tickets/excel', responseType: 'blob' })
}
